74ed2c0db5037ac161f7f32d210f2726cf83ec6b,src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java,SCMBinder,create,#FlowExecutionOwner#TaskListener#List#,58

Before Change


        SCM scm;
        if (tip != null) {
            build.addAction(new SCMRevisionAction(tip));
            SCMRevision rev = scmSource.getTrustedRevision(tip, listener);
            try (SCMFileSystem fs = SCMFileSystem.of(scmSource, head, rev)) {
                if (fs != null) { // JENKINS-33273
                    String script = null;
                    try {
                        script = fs.child(WorkflowBranchProjectFactory.SCRIPT).contentAsString();
                        listener.getLogger().println("Obtained " + WorkflowBranchProjectFactory.SCRIPT + " from " + rev);
                    } catch (IOException | InterruptedException x) {
                        listener.error("Could not do lightweight checkout, falling back to heavyweight").println(Functions.printThrowable(x).trim());
                    }
                    if (script != null) {
                        return new CpsFlowDefinition(script, true).create(handle, listener, actions);
                    }
                }
            }
            scm = scmSource.build(head, rev);
        } else {
            listener.error("Could not determine exact tip revision of " + branch.getName() + "; falling back to nondeterministic checkout");
            // Build might fail later anyway, but reason should become clear: for example, branch was deleted before indexing could run.

After Change


        if (scmSource == null) {
            throw new IllegalStateException(branch.getSourceId() + " not found");
        }
        SCMHead head = branch.getHead();
        SCMRevision tip = scmSource.fetch(head, listener);
        SCM scm;
        if (tip != null) {
            scm = scmSource.build(head, scmSource.getTrustedRevision(tip, listener));
            build.addAction(new SCMRevisionAction(tip));
        } else {
            listener.error("Could not determine exact tip revision of " + branch.getName() + "; falling back to nondeterministic checkout");